/* 全局样式 */
/* * {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
} */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f8f9fa;
    min-height: 100vh;
    color: #2d3436;
}

/* 顶部导航栏 */
header {
    background: linear-gradient(135deg, #0097e6, #00a8ff);
    color: white;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

header h1 i {
    font-size: 1.8rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info a {
    color: white;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.user-info a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* 退出按钮动画 */
.user-info a {
    position: relative;
    overflow: hidden;
}

.user-info a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    transform: translateX(-100%) rotate(45deg);
    transition: transform 0.3s ease;
}

.user-info a:hover::before {
    transform: translateX(100%) rotate(45deg);
}

/* 页面布局 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}


/* 导航样式 */
nav {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-top: 88px;
}

nav ul {
    list-style: none;
}

nav a {
    color: #2d3436;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

nav a:hover {
    background: #f1f2f6;
    color: #0984e3;
}

/* 容器样式 */
#app {
    padding: 20px; /* 内边距 */
}

/* 统计卡片容器 */
.stats-container {
    display: flex; /* 使用 Flexbox */
    justify-content: space-between; /* 均匀分布 */
    margin-bottom: 20px; /* 下边距 */
}

/* 操作栏样式 */
.action-bar {
    display: flex; /* 使用 Flexbox */
    justify-content: space-between; /* 均匀分布 */
    align-items: center; /* 垂直居中 */
    margin-bottom: 20px; /* 下边距 */
}

/* 搜索框样式 */
.search-box {
    display: flex; /* 使用 Flexbox */
    align-items: center; /* 垂直居中 */
}

.search-box input[type="text"] {
    border: 1px solid #ced4da; /* 边框颜色 */
    border-radius: 4px; /* 圆角 */
    padding: 10px; /* 内边距 */
    width: 250px; /* 宽度 */
    margin-right: 10px; /* 右边距 */
}

/* 按钮样式 */
.btn {
    background-color: #007bff; /* 主色调 */
    color: white; /* 字体颜色 */
    border: none; /* 去掉边框 */
    border-radius: 4px; /* 圆角 */
    padding: 10px 15px; /* 内边距 */
    cursor: pointer; /* 鼠标指针 */
    transition: background-color 0.3s; /* 动画效果 */
}

.btn:hover {
    background-color: #0056b3; /* 悬停时的颜色 */
}

/* 主要内容区域 */
main {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* 操作栏 */
.action-bar {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* 按钮样式 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0878d3;
    transform: translateY(-1px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #d63031;
    transform: translateY(-1px);
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 8px;
    overflow: hidden;
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.table th {
    background: #f8f9fa;
    font-weight: 500;
    color: #2d3436;
}

.table tr:hover {
    background: #f8f9fa;
}

.table td .btn {
    padding: 6px 12px;
    font-size: 13px;
    margin-right: 5px;
}

/* 模态框背景 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(8px);
    animation: modalFadeIn 0.3s ease;
}

/* 模态框容器 */
.modal-content {
    width: 380px;
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 模态框标题 */
.modal-content h3 {
    font-size: 18px;
    color: #1a1a1a;
    font-weight: 600;
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #edf2f7;
    position: relative;
}

/* 表单组样式 */
.form-group {
    margin-bottom: 16px;
    position: relative;
}

/* 表单标签 */
.form-group label {
    display: block;
    font-size: 13px;
    color: #4a5568;
    margin-bottom: 6px;
    font-weight: 500;
}

/* 输入框样式 */
.form-group input,
.form-group select {
    width: 93%;
    height: 36px;
    padding: 0 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #1a1a1a;
    font-size: 14px;
    transition: all 0.2s ease;
}

/* 输入框悬停效果 */
.form-group input:hover,
.form-group select:hover {
    border-color: #cbd5e0;
    background: #fff;
}

/* 输入框聚焦效果 */
.form-group input:focus,
.form-group select:focus {
    border-color: #3498db;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
    outline: none;
}

/* 按钮容器 */
.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #edf2f7;
}

/* 保存按钮 */
.btn-save {
    flex: 1;
    height: 36px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-save:hover {
    background: #2188cd;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.25);
}

/* 取消按钮 */
.btn-cancel {
    flex: 1;
    height: 36px;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-cancel:hover {
    background: #e2e8f0;
    color: #475569;
}

/* 动画效果 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(8px);
    }
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式调整 */
@media (max-width: 480px) {
    .modal-content {
        width: 300px;
        margin: 0 16px;
        padding: 20px;
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .table {
        display: block;
        overflow-x: auto;
    }

    .modal-content {
        width: 95%;
        margin: 0 10px;
    }

    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
} 

/* 表格样式增强 */
.table thead th {
    background: #2980b9;
    color: white;
    font-weight: 500;
    padding: 15px;
    font-size: 14px;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.table tbody tr:hover {
    background: #e3f2fd;
    transform: translateX(5px);
}

/* 操作按钮美化 */
.table .btn {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.table .btn i {
    font-size: 12px;
}

.btn-edit {
    background: #3498db;
    color: white;
}

.btn-edit:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

/* 添加用户按钮美化 */
.action-bar .btn-primary {
    background: linear-gradient(45deg, #2980b9, #3498db);
    padding: 10px 20px;
    font-weight: 500;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.action-bar .btn-primary i {
    font-size: 16px;
}

.action-bar .btn-primary:hover {
    background: linear-gradient(45deg, #3498db, #2980b9);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

/* 角色标签样式 */
.role-tag {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    display: inline-block;
}

.role-1 {
    background: #e3f2fd;
    color: #1976d2;
}

.role-2 {
    background: #e8f5e9;
    color: #2e7d32;
}

.role-3 {
    background: #fff3e0;
    color: #f57c00;
}

/* 加载动画 */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    width: 50px;
    height: 50px;
    background: #e3f2fd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #1890ff;
}

.stat-info h3 {
    color: #666;
    font-size: 14px;
    margin-bottom: 5px;
}

.stat-info p {
    color: #1a1a1a;
    font-size: 24px;
    font-weight: 600;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
/* 提示信息样式 */
.message {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 媒体查询 */
@media (max-width: 1200px) {
    .stats-container {
        flex-direction: row; /* 在中等屏幕上保持水平排列 */
        justify-content: center; /* 居中对齐 */
    }

    .stat-card {
        flex: 1 1 150px; /* 调整卡片宽度 */
        margin: 10px; /* 添加间距 */
    }
}

@media (max-width: 768px) {
    .stats-container {
        flex-direction: column; /* 在小屏幕上垂直排列 */
        align-items: center; /* 居中对齐 */
    }

    .stat-card {
        width: 100%; /* 卡片宽度占满 */
        margin: 10px 0; /* 上下间距 */
    }

    .action-bar {
        flex-direction: column; /* 垂直排列 */
        align-items: center; /* 居中对齐 */
    }

    .table {
        font-size: 14px; /* 调整表格字体大小 */
    }
}

@media (max-width: 480px) {
    header {
        font-size: 18px; /* 调整标题字体大小 */
    }

    .stat-info h3 {
        font-size: 14px; /* 调整卡片标题字体大小 */
    }

    .stat-info p {
        font-size: 20px; /* 调整卡片数字字体大小 */
    }

    .table th, .table td {
        padding: 8px; /* 调整表格内边距 */
    }
}
